<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="icon" th:href="@{https://v3.bootcss.com/favicon.ico}">
    <title>员工列表</title>
    <link th:href="@{/css/dashboard.css}" rel="stylesheet">
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
    <link th:href="@{/css/dashboard.css}" rel="stylesheet">
  </head>
  <body>
  <div th:insert="~{commons/commons::topbar}"></div>
    <div class="container-fluid">
      <div class="row">

        <div th:insert="~{commons/commons::sidebar(active = 'list.html')}"></div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
          <h1 class="page-header">控制台</h1>
          <div class="row placeholders">
          </div>
          <h2 class="sub-header"><a class="btn btn-sm btn-success" th:href="@{/emp}">新增员工</a></h2>
          <div class="table-responsive">
            <table class="table table-striped">
              <thead>
              <tr>
                <th>编号</th>
                <th>姓名</th>
                <th>邮箱</th>
                <th>性别</th>
                <th>部门</th>
                <th>生日</th>
                <th>操作</th>
              </tr>
              </thead>
              <tbody>
              <tr th:each="emp : ${emps}">
                <td th:text="${emp.getId()}"></td>
                <td th:text="${emp.getLastName()}"></td>
                <td th:text="${emp.getEmail()}"></td>
                <td>[[${emp.getGender() == 0 ? '女':'男'}]]</td>
                <td th:text="${emp.getDepartment().getDepartmentName()}"></td>
                <td th:text="${#dates.format(emp.getBirth(), 'yyyy-MM-dd HH-mm:ss')}"></td>
                <td>
                  <a class="btn btn-sm btn-primary" th:href="@{/emp/} + ${emp.getId()}">编辑</a>
                  <a class="btn btn-sm btn-danger" th:href="@{/deleEmp/} + ${emp.getId()}">删除</a>
                </td>
              </tr>
              </tbody>
            </table>
          </div>
        </div>
      </div>
    </div>

</body></html>